This invention relates to the field of data processing systems. More particularly, this invention relates to the management of conflicting memory accesses to a memory within a data processing apparatus.
It is known to provide data processing apparatus including a memory to which memory accesses are made. The data processing apparatus may include multiple sources of memory access requests. As an example, a data processing system may include multiple processors each executing program instructions and sharing a common memory address space. A known problem with this arrangement is that memory accesses may conflict and give rise to coherency problems and other hazards, e.g. write-after-write hazards, read-after-write hazards etc. One known technique for dealing with these problems is to employ memory locks. With this approach, a processor wishing to access a memory item which is shared with another processor will first request to take possession of a lock and only when this lock is obtained will the memory access be allowed to proceed. When the memory access has finished, then the lock will be released. If another processor was already undertaking a memory access to that memory item, then the lock would not be available and so the potential conflict would be prevented and the requesting process will retry to obtain the lock at a later time. While such a memory lock approach is safe, it has the problem of reducing the performance as a number of extra steps need to be taken before a memory access can be performed.
Another approach to this problem is to use speculative memory accesses in which a memory access is initiated and then hardware monitors to determine if another conflicting, or potentially conflicting, memory access issues before the first memory access has completed and committed its results. If such another conflicting memory access arises, then the first memory access is cancelled and retried at a later time. While such an approach may improve performance in some circumstances, e.g. when conflicts are unlikely, it can have the effect of reducing performance, or even in some pathological cases, blocking any forward progress as the level of conflicts rises.